#include <iostream>
using namespace std;

class Student {
public:
	Student (const string& name, const int& age, const int& no) {
		cout << "类的构造函数" << endl;
		m_name = name;
		m_age = age;
		m_no = no;
	}
	void who (void) {
		cout << "我是" << m_name << " , 今年" << m_age << 
			" ,学号是" << m_no << endl;
	}
private:
	string m_name;
	int m_no;
	int m_age;
};


int main (void)
{
	//创建对象, 实例化对象, 构造对象 
	//Student s("朱高炽", 38, 10002);
	//Student s = Student ("朱高炽", 38, 10002);
	Student arr[3] = {
		Student ("朱高炽", 38, 10002),
		Student ("朱高煦", 40, 10003),
		Student ("朱高遂", 39, 10004),
	}
	;	
	Student *ps = new Student ("朱瞻基", 36, 10005);
	Student *parr = new Student[2] {
		Student ("朱祁钰", 30, 10006),
		Student ("朱祁镇", 40, 10007),
	};

	arr[0].who();
	arr[1].who();
	arr[2].who();
	ps->who();
	parr[0].who(); //*(parr+0).who()
	parr[1].who(); //*(parr+1).who()

	delete ps;
	delete[] parr;
	ps = NULL;
	parr = NULL;
	return 0;
}












